package com.farm.area.dao;

import com.farm.area.pojo.FarmArea;
import com.farm.area.pojo.FarmLand;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author azhe
 * @create 2020/10/10
 */
@Repository
public interface FarmAreaMapper extends Mapper<FarmArea> {

    @Select("SELECT cf.*,c.name cusName FROM t_cust_farm cf, t_customer c where cf.customer_id = c.id")
    public List<Map<String, Object>> findAll();

    @Select("select * from t_cust_farmland where farm_id=#{id}")
    List<FarmLand> findFarmLandById(Integer id);
}
